﻿function fnCustomAdd()
{
    mini.open({
        url: "/ExtendPage/editview/DefineEditForm.aspx?channel_id=" + treeId + "&formcode=" + getPar("formcode") + "&entity=" + const_EditEntity + "&functionid=" + const_functionId + "&id=",
        title: "新增" + const_PageTitle, width: _openWindowWidth, height: _openWindowHeight,
        onload: function () {

        },
        ondestroy: function (action) {
            grid.reload();
        }
    });
}

function fnCustomEdit() {
    var row = fnGetSelectedRow();
    //debugger
    if (row) {
        mini.open({
            url: "/ExtendPage/editview/DefineEditForm.aspx?channel_id=" + treeId + "&formcode=" + getPar("formcode") + "&view_entity=" + const_ViewEntity + "&entity=" + const_EditEntity + "&functionid=" + const_functionId + "&id=" + row[const_entityID],
            title: "编辑" + const_PageTitle, width: _openWindowWidth, height: _openWindowHeight,
            onload: function () {

            },
            ondestroy: function (action) {
                grid.reload();
            }
        });
    }
}

function fnCustomNodeSelect(e) {
    treeId = e.node.id;
    const_TreeCustomCondition = "channel_id='" + e.node.id + "'";
    grid.setUrl("../data/jsondata.aspx?type=1&entity=" + const_entityName + "&order=" + const_Order + "&desc=" + const_Desc + "&datagrid=true&pagesize=1000&customCondition=&condition=" + const_TreeCustomCondition);
    grid.load({ /*condition:"channel_id='"+e.node.id+"'"*/ });
}
